package com.juyu.miliao.api.rabbitMQ;

import com.juyu.miliao.common.constant.SpringFestivalActivitiesRabbitMqInfo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils;

/**
 * 礼物墙rabbitmq
 *
 * @author xuanqicheng
 * @create 2019-18-13:42
 */
@Component
@Slf4j
public class SpringFestivalActivitiesRabbitMq {

    @Autowired
    private AmqpTemplate amqpTemplate;


    public void sendSpringFestivalActivitiesMessage(String message) {
        if (!StringUtils.isEmpty(message)) {
            amqpTemplate.convertAndSend(SpringFestivalActivitiesRabbitMqInfo.SPRING_FESTIVAL_EXCHANGE,
                    SpringFestivalActivitiesRabbitMqInfo.SPRING_FESTIVAL_KEY, message);

        }


    }

}
